﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Collections;

namespace WebApplication1
{
    public partial class _Default : System.Web.UI.Page
    {
        private DataTable dt = new DataTable();
        void CreateDataSource()
        {
            
            DataRow dr;

            dt.Columns.Add(new DataColumn("Vendor", typeof(string)));
            dt.Columns.Add(new DataColumn("BookName", typeof(string)));
            dt.Columns.Add(new DataColumn("BookAuthor", typeof(string)));

            //dt.Columns.g
            for (int i = 0; i < 10; i++)
            {
                dr = dt.NewRow();
                dr[0] = "Vendor " + i.ToString();
                dr[1] = "Book " + i.ToString();
                dr[2] = "Authors " + i.ToString();
                dt.Rows.Add(dr);
            }

            DataView dv = new DataView(dt);
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                CreateDataSource();
                searchResultList.DataSource = dt;
                searchResultList.DataBind();
            }
        }

        protected void searchButton_Click(object sender, EventArgs e)
        {
                DataTable dt = new DataTable();

           // searchResultList.DataSource

            /*  
            if (searchResultList.Items.Count > 0)
            {
                Label1.Text = "The Items collection contains: <br />";

                foreach (DataListItem item in searchResultList.Items)
                {

                    Label1.Text += ((DataBoundLiteralControl)item.Controls[0]).Text +
                                   "<br />";
                }
            }
            */


             
        }

    }
}
